﻿using System;
using System.Collections.Generic;
using JetBrains.Annotations;
using MugenMvvmToolkit.Models;

namespace MugenMvvmToolkit.Interfaces
{
    /// <summary>
    ///     Represents the view-model settings.
    /// </summary>
    public interface IViewModelSettings
    {
        /// <summary>
        ///     Gets or sets property, which responsible to auto dispose container when the view model disposing.
        /// </summary>
        bool DisposeIocAdapter { get; set; }

        /// <summary>
        ///     Gets or sets property, which responsible to auto dispose all command when the view model disposing.
        /// </summary>
        bool DisposeCommands { get; set; }

        /// <summary>
        ///     Gets or sets the value that responsible for listen busy messages
        ///     see the <see cref="BeginBusyMessage" /> and the <see cref="EndBusyMessage" />.        
        /// </summary>
        HandleType HandleBusyMessageMode { get; set; }

        /// <summary>
        ///     Gets or sets value which will be displayed when invoke BeginIsBusy without message.
        /// </summary>
        object DefaultBusyMessage { get; set; }

        /// <summary>
        ///     Gets or sets value which will be displayed when invoke BeginIsBusy without message.
        /// </summary>
        object ValidationBusyMessage { get; set; }

#if !NONOTIFYDATAERROR
        /// <summary>
        ///     Specifies the execution mode for invoke <c>OnErrorsChanged</c> method.
        /// </summary>
        ExecutionType ErrorsChangeExecutionMode { get; set; }
#endif
        /// <summary>
        ///     Gets or sets the metadata factory.
        /// </summary>
        [CanBeNull]
        Func<IDictionary<object, object>> MetadataFactory { get; set; }

        /// <summary>
        ///     Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>
        ///     A new object that is a copy of this instance.
        /// </returns>
        IViewModelSettings Clone();
    }
}